<%@ page language="java" import="java.util.*" contentType="text/html; charset=gb2312"
    pageEncoding="gb2312"%>
 <%@page import="java.sql.*" %>
 <%
   
 
    	Connection conn = null;   
    	Statement stmt = null;   
    	ResultSet rs = null;   
    	
    	String driver = "com.mysql.jdbc.Driver";   
    	String url = "jdbc:mysql://localhost/catan?user=root&password=root";   
    	String sql = "select * from test";   
    	
    	 Class.forName(driver);   
    	 conn = DriverManager.getConnection(url, "root", "root");   
    	 stmt = conn.createStatement();   
    	 rs = stmt.executeQuery(sql);   
   
    try{
    
    int i=1;
    out.println("<table border='1'>");
    while(rs.next()){
    	
    out.println("<tr><td>"+rs.getInt(3)+"</td>"+"<td>"+rs.getString(2)+"</td><td>"+rs.getString(3)+"</td><td>"+rs.getString(4)+"</td></tr>");
    i++;
    }
    out.println("</table>");
    } catch(Exception e)
	   { 
		   System.out.println(e.getMessage());

	   }    
 %>
